<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/wmsproject/stocktask/Wms_StockTask.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/wmsproject/stocktask/Wms_StockTask.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Wms_StockTask",
        setup() {
            const table = ref({
                key: "StockTaskId",
                footer: "Foots",
                cnName: "库位任务表",
                name: "stocktask/Wms_StockTask",
                newTabEdit: false,
                url: "/Wms_StockTask/",
                sortName: "StockTaskId"
            });
            const editFormFields = ref({"TaskNo":"","TaskType":"","OrderId":"","TaskStatus":"","WarehouseId":"","StartStockId":"","DestStockId":"","GoodsType":"","Seq":"","IsWcs":"","SendWcsStatus":"","Msg":"","Remarks":""});
            const editFormOptions = ref([[{"title":"任务编号","required":true,"field":"TaskNo"}],
                              [{"dataKey":"WMS_TaskType","data":[],"title":"任务类型","required":true,"field":"TaskType","type":"select"},
                               {"dataKey":"WMS_Order","data":[],"title":"单据","field":"OrderId","type":"select"},
                               {"dataKey":"WMS_TaskStatus","data":[],"title":"任务状态","required":true,"field":"TaskStatus","type":"select"}],
                              [{"dataKey":"WMS_Warehouse","data":[],"title":"仓库","field":"WarehouseId","type":"select"},
                               {"dataKey":"WMS_StockAndPosition","data":[],"title":"起始位置","field":"StartStockId","type":"select"},
                               {"dataKey":"WMS_StockAndPosition","data":[],"title":"目标位置","field":"DestStockId","type":"select"}],
                              [{"title":"任务顺序;主任务默认为0","field":"Seq","type":"number"},
                               {"dataKey":"仓储容器类型","data":[],"title":"容器还是产品","required":true,"field":"GoodsType","type":"select"},
                               {"dataKey":"enabled","data":[],"title":"是否WCS任务","field":"IsWcs","type":"switch"}],
                              [{"dataKey":"enabled","data":[],"title":"下发任务状态","field":"SendWcsStatus","type":"select"},
                               {"title":"错误信息","field":"Msg","colSize":12,"type":"textarea"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"TaskNo":"","TaskType":"","TaskStatus":"","TaskBarcode":"","WarehouseId":"","StartStockId":"","DestStockId":""});
            const searchFormOptions = ref([[{"title":"任务条码（物料/容器）","field":"TaskBarcode","type":"like"},{"dataKey":"WMS_TaskType","data":[],"title":"任务类型","field":"TaskType","type":"select"},{"dataKey":"WMS_TaskStatus","data":[],"title":"任务状态","field":"TaskStatus","type":"select"}],[{"dataKey":"WMS_Warehouse","data":[],"title":"仓库","field":"WarehouseId","type":"select"},{"dataKey":"WMS_StockAndPosition","data":[],"title":"起始位置","field":"StartStockId","type":"select"},{"dataKey":"WMS_StockAndPosition","data":[],"title":"目标位置","field":"DestStockId","type":"select"}],[{"title":"任务编号","field":"TaskNo"}]]);
            const columns = ref([{field:"StockTaskId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"TaskNo",title:"任务编号",type:"string",link:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"TaskCategory",title:"任务分类",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"TaskType",title:"任务类型",type:"int",bind:{ key:"WMS_TaskType",data:[]},width:90,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderId",title:"单据",type:"bigint",bind:{ key:"WMS_Order",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"TaskStatus",title:"任务状态",type:"int",bind:{ key:"WMS_TaskStatus",data:[]},width:90,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"GoodsType",title:"容器还是产品",type:"int",bind:{ key:"仓储容器类型",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"TaskBarcode",title:"任务条码（物料/容器）",type:"string",width:120,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseId",title:"仓库",type:"bigint",bind:{ key:"WMS_Warehouse",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"StartStockId",title:"起始位置",type:"bigint",bind:{ key:"WMS_StockAndPosition",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"DestStockId",title:"目标位置",type:"bigint",bind:{ key:"WMS_StockAndPosition",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"MainTaskId",title:"主任务ID;多任务时标注主任务ID，表示一组任务",type:"bigint",width:110,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"Seq",title:"任务顺序;主任务默认为0",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsWcs",title:"是否WCS任务",type:"int",bind:{ key:"enabled",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"SendWcsStatus",title:"下发任务状态",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Msg",title:"错误信息",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"}]);
            const detail = ref(  {
                    cnName: "库位任务明细表",
                    table: "Wms_StockTaskDetail",
                    columns: [{field:"StockTaskDetailId",title:"ID",type:"bigint",width:120,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockTaskId",title:"任务ID",type:"bigint",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialId",title:"物料",type:"bigint",bind:{ key:"WMS_Material",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"LotNo",title:"批次号",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"LotDateCode",title:"批次日期",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Qty",title:"数量",type:"decimal",width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"VendorId",title:"供应商ID",type:"bigint",bind:{ key:"BASE_Vendor",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Sn",title:"条码信息",type:"string",width:120,showOverflowTooltip:true,align:"left"}],
                    sortName: "CreateTime",
                    key: "StockTaskDetailId"
                                            });
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
